﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

@model  dPet.Application.DataObjects.HospitalDto

<div class="clearfix">
	<h4>编辑医院信息</h4>

	<hr />

	@using (Html.BeginForm("SaveHospital", "Manage", FormMethod.Post, new { id = "save_hospital_form" }))
	{
		<div class="panel panel-default">
			<div class="panel-heading">
				<button id="btn_cancel" type="button" class="btn btn-sm btn-default" onclick="window.history.go(-1);"><span class="glyphicon glyphicon-chevron-left"></span> 返 回</button>
				<button id="btn_submit" type="submit" class="btn btn-sm btn-success"><span class="glyphicon glyphicon-floppy-disk"></span> 保 存</button>
			</div>

			<div class="panel-body form-horizontal">
				@Html.HiddenFor(x => x.Id)

				<div class="form-group">
					<label for="Name" class="col-md-1 control-label">名　　称</label>
					<div class="col-md-3">
						@Html.TextBoxFor(x => x.Name, new { @class = "form-control", placeholder = "请输入医院名称" })
					</div>
				</div>
				<div class="form-group">
					<label for="Address" class="col-md-1 control-label">地　　址</label>
					<div class="col-md-3">
						@Html.TextBoxFor(x => x.Address, new { @class = "form-control", placeholder = "请输入医院地址" })
					</div>
				</div>
				<div class="form-group">
					<label for="PhoneNumber" class="col-md-1 control-label">电话号码</label>
					<div class="col-md-3">
						@Html.TextBoxFor(x => x.PhoneNumber, new { @class = "form-control", placeholder = "请输入电话号码" })
					</div>
				</div>
				<div class="form-group">
					<label for="FaxNumber" class="col-md-1 control-label">传真号码</label>
					<div class="col-md-3">
						@Html.TextBoxFor(x => x.FaxNumber, new { @class = "form-control", placeholder = "请输入传真号码" })
					</div>
				</div>
			</div>
		</div>
	}
</div>

@section scripts {
	<script type="text/javascript">
		$("#btn_submit").bind("click", function () {
			if ($.trim($("#Name").val()) == '') {
				alert("请输入医院名称");
				return false;
			}

			$("#save_hospital_form").submit();
		});
	</script>
}
